namespace ETestIT.Core.Storage
{
    using System;
    using System.Collections;
    using System.Web;

    public class LocalStorage : Store, ILocalStorage
    {
        // Fields
        [ThreadStatic]
        private static Hashtable _internalStorage;

        // Methods
        protected override Hashtable GetInternalHashtable()
        {
            if (Store.IsWebApplication)
            {
                Hashtable internalStorage = HttpContext.Current.Items[typeof(LocalStorage).FullName] as Hashtable;
                if (internalStorage == null)
                {
                    HttpContext.Current.Items[typeof(LocalStorage).FullName] = internalStorage = new Hashtable();
                }
                return internalStorage;
            }
            if (_internalStorage == null)
            {
                Hashtable hashtable1 = _internalStorage;
            }
            return (_internalStorage = new Hashtable());
        }

        // Properties
        protected override object LockInstance
        {
            get
            {
                return null;
            }
        }

        protected override bool UseLocking
        {
            get
            {
                return false;
            }
        }

    }
}